package olegroshka.src.com.bofa.olegroshka.decorator;


/**
 * Record cell transformation, used to decorate report data. 
 *   
 * @author Oleg
 *
 */
public class Transformation {

	public static Transformation newAsIs(int sourceColumn) {
		return new Transformation(sourceColumn, Decorator.ASIS);
	}
	
	public static Transformation newScaling(int sourceColumn, int scale) {
		return new Transformation(sourceColumn, new BigDecimalDecorator(scale));
	}
	
	private final int sourceColumn;
	private final Decorator<Object, Object> decorator;

	public Transformation(
			int sourceColumn,
			Decorator<Object, Object> decorator) {
		this.sourceColumn = sourceColumn;
		this.decorator = decorator;
	}

	public Decorator<Object, Object> getDecorator() {
		return decorator;
	}

	public int getSourceColumn() {
		return sourceColumn;
	}

}
